package com.xxxx.server.pojo.param;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

/**
 * @describe ：用于找回密码的参数
 * @PageLocation:
 * @Auther xzl
 * @Date 2021/11/18 15:04
 */
@Data
@ApiModel("找回密码的参数")
public class BackPasswordParam {
    @ApiModelProperty(value = "邮箱")
    @NotBlank(message = "不能为空！")
    @Pattern(regexp = "^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+(\\.[a-zA-Z0-9-]+)*\\.[a-zA-Z0-9]{2,6}$",message = "格式不正确！")
    private String email;
    @ApiModelProperty("邮箱验证码")
    @NotBlank(message = "不能为空！")
    private String emailCode;

    @ApiModelProperty("密码")
    @NotBlank(message = "不能为空！")
    @Size(min = 8, max = 15, message = "密码长度不正确")
    @Pattern(regexp = "(?!^(\\d+|[a-zA-Z]+|[~!@#$%^&*?]+)$)^[\\w~!@#$%\\^&*?]+$",message = "密码必须包含字母、数字或特殊字符两种及以上！")
    private String password;

    @ApiModelProperty(value = "确认密码")
    @NotBlank(message = "不能为空！")
    @Size(min = 8, max = 15, message = "密码长度不正确")
    @Pattern(regexp = "(?!^(\\d+|[a-zA-Z]+|[~!@#$%^&*?]+)$)^[\\w~!@#$%\\^&*?]+$",message = "密码必须包含字母、数字或特殊字符两种及以上！")
    private String confirmPassword;
}
